package com.ehome.poct.backend.controller.device;

import com.ehome.core.page.PageInfo;
import com.ehome.poct.base.api.dto.device.DeviceQry;
import com.ehome.poct.base.api.feign.device.TestDeviceBootingDetailFeginClient;
import com.ehome.poct.base.api.feign.device.TestDeviceBootingHistFeginClient;
import com.ehome.poct.base.api.vo.device.BootInfoVO;
import com.ehome.poct.base.api.vo.device.TestDeviceBootingHistVO;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 设备开机自检记录控制器
 *
 * @author laobai
 * @Date 2022-10-14 17:38
 */
@Slf4j
@Api(tags = "设备开机自检记录")
@ApiSupport(author = "laobai")
@RequiredArgsConstructor
@RestController
@RequestMapping("/devicebootinghist")
public class TestDeviceBootingHistController   {
    @Autowired
    TestDeviceBootingHistFeginClient bootingHisFeign;

    /**
     * 获取设备开机记录统计列表信息
     * @param qry 查询条件
     * @return 含分页信息 开机自检概述 几大模块的状态
     */
    @ApiOperation("获取开机自检详细")
    @ApiOperationSupport(author = "laobai")
    @PostMapping("/getsnodetail")
    public PageInfo<TestDeviceBootingHistVO> getSnoDetailList(@RequestBody DeviceQry qry){
        return bootingHisFeign.getSnoDetailList(qry);
    }

    /**
     * 获取设备开机记录统计列表信息
     * @param qry 查询条件 sno和时间
     * @return 设备的开机自检统计信息 分页
     */
    @ApiOperation("获取设备开机记录统计列表信息")
    @ApiOperationSupport(author = "laobai")
    @PostMapping("/getallinfo")
    public PageInfo<BootInfoVO> getAllBootInfo(@RequestBody DeviceQry qry){
        return bootingHisFeign.getAllBootInfo(qry);
    }


}
